package test;
import static org.junit.Assert.*;

import org.junit.Test;


public class EventTest {
	
	Event event = new Event();

	
	@Test
	public void setSummaryTest() {
		event.setSummary("Summary");
		String result = event.summary;
		assertEquals("Summary",result);
	}
	
	@Test
	public void setLocationTest() {
		event.setLocation("Location");
		String result = event.location;
		assertEquals("Location",result);
	}
	
	//START TIME TESTS
	@Test
	public void setStartHourTest() {
		boolean result = event.setStartHour(23);
		assertEquals(true,result);
	}
	
	@Test
	public void setStartMinuteTest() {
		boolean result = event.setStartMinute(59);
		assertEquals(true,result);
	}
	
	@Test
	public void setStartDayTest() {
		boolean result = event.setStartDay(31);
		assertEquals(true,result);
	}
	
	@Test
	public void setStartMonthTest() {
		boolean result = event.setStartMonth(12);
		assertEquals(true,result);
	}
	
	@Test
	public void setStartMonthYear() {
		boolean result = event.setStartYear(2000);
		assertEquals(true,result);
	}
	
	//END START TIME TESTS
	
	@Test
	public void setEndHourTest() {
		boolean result = event.setEndHour(23);
		assertEquals(true,result);
	}
	
	@Test
	public void setEndMinuteTest() {
		boolean result = event.setEndMinute(59);
		assertEquals(true,result);
	}
	
	@Test
	public void setEndDayTest() {
		boolean result = event.setEndDay(31);
		assertEquals(true,result);
	}
	
	@Test
	public void setEndMonthTest() {
		boolean result = event.setEndMonth(12);
		assertEquals(true,result);
	}
	
	@Test
	public void setEndMonthYear() {
		boolean result = event.setEndYear(2000);
		assertEquals(true,result);
	}
	
	@Test
	public void writeFileTest(){
		boolean result = event.writeFile();
		assertEquals(true,result);
	}
	
	@Test
	public void start_date_time_Test(){
		event.setStartYear(2014);
		event.setStartMonth(12);
		event.setStartDay(25);
		event.setStartHour(01);
		event.setStartMinute(0);
		assertEquals("20141225T010000",event.start_date_time.toString());
	}
	
	@Test
	public void end_date_time_Test(){
		event.setEndYear(2014);
		event.setEndMonth(12);
		event.setEndDay(25);
		event.setEndHour(01);
		event.setEndMinute(0);
		assertEquals("20141225T010000",event.end_date_time.toString());
	}
  
  //Recurrence test
  @Test
  public void recurrence_Test(){
    event.setRecurrence(2, 3);
    assertEquals("FREQ=WEEKLY;COUNT=3", event.recurrence);
  }
	
	
	
	

}
